<?php

namespace Run;

class OutSc extends Base {

	protected $reconnect = true;

	/**
	 * 设置初始化川外的初始化分类的页数.
	 * php ./Script/run.php --run=OutSc --function=setListPage --start=1 --end=20
	 */
	public function setListPage($params) {
		if (empty($params['start']) || !(int) $params['start']) {
			echo '请设置开始页数--start={start}' . PHP_EOL;exit;
		}
		if (empty($params['end']) || !(int) $params['end']) {
			echo '请设置开始页数--end={end}' . PHP_EOL;exit;
		}
		$start = (int) $params['start'];
		$end = (int) $params['end'];
		if ($start > $end) {
			echo '开始页数大于了结束页数' . PHP_EOL;exit;
		}
		\Data\Crawl::instance()->setOutScPageList($start, $end);
		echo '设置成功' . PHP_EOL;
	}

	/**
	 * 抓取列表 公司的fid.
	 *
	 * php ./Script/run.php --run=OutSc --function=setCompanyFid --process=20
	 */
	public function setCompanyFid() {
		while(true) {
			$page = \Data\Crawl::instance()->shiftOutScPage();
			if (!$page) {
				$this->log('page list success sleep 60 s');
				sleep(60);
				continue;
			}
			$this->log('开始解析第' . $page . '页');
			$fidToNameList = $this->getCompanyAndFidByPage($page);
			// 存入redis给队列抓取
			foreach ($fidToNameList as $fid => $name) {
				\Data\Crawl::instance()->setListFidToName($fid, $name);
			}
			$this->log('第' . $page . '页解析完成');
		}
	}

	/**
	 * 抓取详情页.
	 *
	 * php ./Script/run.php --run=OutSc --function=getDetail
	 */
	public function getDetail() {
		$data = \Data\Category::instance();
		while (true) {
			$result = \Data\Crawl::instance()->shiftFiDToName();
			if (!$result) {
				$this->log('川外数据抓取完毕');exit;
			}
			// 抓取公司资质页面
			$fid = key($result);
			$companyName = current($result);

			$html = $this->getEntCerInfoRCHtml($fid, 5);

			$item = $this->parseCategoryInfo($html, $fid);
			$itemResult = array();
			foreach ($item as $val) {
				// 踢出掉不在几大相中的
				$array = array(
					'设计与施工一体化',
					'劳务分包',
					'专业承包',
					'施工总承包',
					'专项资质',
				);
				$is = false;
				foreach ($array as $s) {
					if (mb_strpos($val, $s) === 0) {
						$is = true;
						continue;
					}
				}
				if (!$is) {
					continue;
				}
				$val = str_replace(array('（', '）'), array('(', ')'), $val);
				$info = \Data\Certificate::instance()->getCategoryIdAndLevelIdByName($val);
				if (!$info) {
					$itemResult[$val]['CategoryId'] = 0;
					$itemResult[$val]['LevelId'] = 0;
				} else {
					$itemResult[$val]['CategoryId'] = $info[0];
					$itemResult[$val]['LevelId'] = $info[1];
				}
			}
			if (!$itemResult) {
				continue;
			}
			// 抓取公司基本信息
			$detailHtml = $this->getDetailHtml($fid);
			$company = $this->parseDetail($fid, $detailHtml, $companyName, $branch);
			// 解析证书信息
			$certificateGroup = $this->parseCertificateGroup($html, $fid);
			// 添加公司
			$companyId = \Data\Company::instance()->updateCompanyAndInsert($company);
			// 添加分子机构
			if ($branch && !empty($branch['BranchName'])) {
				$branch['CompanyId'] = $companyId;
				\Data\Branch::instance()->updateBranchAndInsert($branch);
			}
			$certificateGroup['Type'] = \Data\Certificate::TYPE_OUT_SC;
			$certificateGroup['CompanyId'] = $companyId;
			// 添加证书
			\Data\Certificate::instance()->updateCertificateGroupAndInsert($certificateGroup);
			// 添加资质
			$isMaster = \Data\Base::IS_YES;
			foreach ($itemResult as $name => $arr) {
				$categoryId = $arr['CategoryId'];
				$levelId = $arr['LevelId'];
				$certificate = array();
				$certificate['CompanyId'] = $companyId;
				$certificate['CategoryId'] = $categoryId;
				$certificate['LevelId'] = $levelId;
				$certificate['Name'] = $name;
				$certificate['ReleaseOrgan'] = $certificateGroup['ReleaseOrgan'];
				$certificate['Status'] = $certificateGroup['Status'];
				$certificate['Type'] = \Data\Base::TYPE_OUT_SC;
				$certificate['IsMaster'] = $isMaster;
				\Data\Certificate::instance()->updateCertificateAndInsert($certificate);
				$isMaster = \Data\Base::IS_NO;
			}
			$this->log('入川企业' . $fid  . ' 抓取完毕');
		}
	}

	/**
	 * 重新设置资质名称对应到分类与等级
	 *
	 * php ./Script/run.php --run=OutSc --function=resetCertificateNameToValue
	 */
	public function resetCertificateNameToValue() {
		// 获取资质的最大id
		$maxId = \Data\Certificate::instance()->getMaxId();
		$i = 1;
		while ($i <= $maxId) {
			$start = $i;
			$i += 200   ;
			$end = $i - 1;
			if ($end >= $maxId) {
				$end = $maxId;
			}
			$result = \Data\Certificate::instance()->getCertificateInfoMinIdAndMaxId($start, $end);
			// 把获取到的信息存入redis
			foreach ($result as $val) {
				$name1 = $val['CertificateName'];
				$name2 = $val['CategoryPName'] . $val['CategoryName'];
				$name3 = $name2;
				if ($val['Mark']) {
					$name3 = $name2 . '(' . $val['Mark'] . ')';
				}
				\Data\Certificate::instance()->cacheCertificateNameToValue($name1, $val['CategoryId'], $val['LevelId']);
				if ($name2 != $name1) {
					\Data\Certificate::instance()->cacheCertificateNameToValue($name2, $val['CategoryId'], $val['LevelId']);
				}
				if ($name3 != $name1 && $name3 != $name2) {
					\Data\Certificate::instance()->cacheCertificateNameToValue($name2, $val['CategoryId'], $val['LevelId']);
				}
			}
		}
		// 拿到所有的分类信息
		$all = \Data\Category::instance()->getLevelCategory();
		// 到到所有的等级信息
		$levelAll = \Data\Level::instance()->findAll();
		foreach ($all as $p) {
			$pName = $p['CategoryName'];
			foreach ($p['List'] as $val) {
				$name = $val['CategoryName'];
				$categoryId = $val['CategoryId'];
				foreach ($levelAll as $level) {
					$levelName = $level['Name'];
					$levelId = $level['LevelId'];
					$certificateName = $pName . $name . $levelName;
					\Data\Certificate::instance()->cacheCertificateNameToValue($certificateName, $categoryId, $levelId);
				}
			}
		}
		echo '设置成功' . PHP_EOL;exit;
	}

	private function parseDetail($fid, $detailHtml, $companyName, &$branch) {
		$company = array();
		$branch = array();
		$company['Name'] = $companyName;
		$company['Fid'] = $fid;
		$company['IsSc'] = \Data\Company::IS_NO;
		preg_match_all('/<td.*?>(.*?)<\/td>/is', $detailHtml, $matches);
		if (empty($matches[1])) {
			$this->error('解析公司详情业出错', $fid, \Data\CrawlError::ERROR_OUT_SC_ENTCERINFO_DETAIL);
		}
		$arr = $matches[1];
		foreach ($arr as &$val) {
			$val = strip_tags($val);
			$val = trim($val);

		}
		foreach ($arr as $key => $val) {
			if ($val == '营业执照注册号') {
				$company['LicenseNumber'] = $arr[$key + 1];
			}
			if ($val == '组织机构代码') {
				$branch['BranchNumber'] = $arr[$key + 1];
			}
			if ($val == '法定代表人') {
				$company['Legal'] = $arr[$key + 1];
			}
			if ($val == '注册地址') {
				$company['RegisterAddress'] = $arr[$key + 1];
			}
			if ($val == '所在省市区') {
				$company['Location'] = $arr[$key + 1];
			}
			if ($val == '分支机构名称') {
				$branch['BranchName'] = $arr[$key + 1];
			}
			if ($val == '分支机构地址') {
				$branch['BranchAddress'] = $arr[$key + 1];
			}
			if ($val == '分支机构营业执照号') {
				$branch['BranchLicenseNumber'] = $arr[$key + 1];
			}
			if ($val == '分支机构税务登记证号') {
				$branch['BranchTaxNumber'] = $arr[$key + 1];
			}
			if ($val == '分支机构负责人') {
				$branch['BranchPrincipal'] = $arr[$key + 1];
			}
		}
		return $company;
	}

	private function getDetailHtml($fid, $timeout = 5) {
		$url = 'http://web.scjst.gov.cn/webSite/project_EntCredit/EntBaseInfo_RC.aspx?FId=' . $fid;
		$header = array(
			'Host:web.scjst.gov.cn',
			'Referer:http://web.scjst.gov.cn/webSite/project_EntCredit/EntInfo.aspx?Fid=2f61ca87-f6c6-4bf7-ae04-5b118e9c845e180&type=RCQY',
			'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'
		);
		$html = \Lib\Util\Comm::request($url, null, $timeout, $header);
		if (!$html) {
			$this->log('抓取详情页超时 .' . $fid);
			return $this->getDetailHtml($fid, $timeout);
		}
		$html = \Lib\Util\Comm::unescape($html);
		return $html;
	}

	private function parseCategoryInfo($html, $fid) {
		preg_match('/<font.*?<\/table>/', $html, $matches);
		if (empty($matches[0])) {
			$this->error('解析资质出错', $fid, \Data\CrawlError::ERROR_OUT_SC_ENTCERINFO_ITEM);
		}
		$str = $matches[0];
		preg_match_all('/<td.*?>(.*?)<\/td>/', $str, $matches);
		if (empty($matches[1])) {
			$this->error('解析资质出错,2', $fid, \Data\CrawlError::ERROR_OUT_SC_ENTCERINFO_ITEM);
		}
		$tmp = $matches[1];
		array_shift($tmp);
		array_shift($tmp);
		array_shift($tmp);
		$tmp = array_values($tmp);
		$result = array();
		for ($i = 0; $i < count($tmp); $i++) {
			if ($i % 2 == 0) {
				$result[] = $tmp[$i];
			}
		}
		if (!$result) {
			//$this->error('一个资质都没有,3', $fid, \Data\CrawlError::ERROR_OUT_SC_ENTCERINFO_ITEM);
		}
		return $result;
	}

	/**
	 * 获取公司资质信息页面.
	 *
	 * @param     $fid
	 * @param int $timeout
	 *
	 * @return mixed|string
	 */
	private function getEntCerInfoRCHtml($fid, $timeout = 5) {
		$url = 'http://web.scjst.gov.cn/webSite/project_EntCredit/EntCerInfo_RC.aspx?FId=' . $fid;
		$header = array(
			'Referer:http://web.scjst.gov.cn/webSite/project_EntCredit/EntInfo.aspx?Fid=56422e67-eeb4-45a3-bac2-fbeec820bdf3130&type=RCQY',
			'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
		);
		$html = \Lib\Util\Comm::request($url, null, $timeout, $header);
		if (!$html) {
			$this->log('获取公司资质信息页面超时');
			return $this->getEntCerInfoRCHtml($fid, $timeout);
		}
		$html = \Lib\Util\Comm::unescape($html);
		// 获取第一个表单里面的数据
		preg_match('/<table\s+class="table2".*?<\/table>.*<\/table>?/is', $html, $matches);
		if (empty($matches[0])) {
			$this->log('解析公司证书资质中的table失败');
			$this->error('解析公司证书资质中的table失败', $fid, \Data\CrawlError::ERROR_OUT_SC_ENTCERINFO_TABLE);
		}
		return $matches[0];
	}

	private function parseCertificateGroup($html, $fid) {
		preg_match_all('/<td.*?>(.*?)<\/td>/is', $html, $matches);
		$result = $matches[1];
		foreach ($result as &$val) {
			$val = strip_tags($val);
			$val = trim($val);
		}
		$certificateGroup = array();
		foreach ($result as $key => $val) {
			if ($val == '登记验证证书编号') {
				$certificateGroup['VerifyCertificateNumber'] = $result[$key + 1];
			} elseif ($val == '登记验证时间') {
				$time = $result[$key + 1];
				$time = $time ? strtotime($time) : 0;
				$certificateGroup['CertificateStartTime'] = (int) $time;
			} elseif ($val == '登记验证证有效期至') {
				$time = $result[$key + 1];
				$time = preg_replace('/\(.*?\)/', '', $time);
				$time = $time ? strtotime($time) : 0;
				$certificateGroup['CertificateEndTime'] = (int) $time;
			} elseif ($val == '资质证书编号') {
				$certificateGroup['CertificateNumber'] = $result[$key + 1];
			} elseif ($val == '登记验证证书核发机关') {
				$certificateGroup['ReleaseOrgan'] = $result[$key + 1];
			} elseif ($val == '安全生产许可证号') {
				$certificateGroup['SecurityNumber'] = $result[$key + 1];
			} elseif ($val == '安许证有效期') {
				$time = $result[$key + 1];
				$time = preg_replace('/\(.*?\)/', '', $time);
				$time = $time ? strtotime($time) : 0;
				$certificateGroup['SecurityEndTime'] = (int) $time;
			} elseif ($val == '证书状态') {
				$status = $result[$key + 1] == '有效' ? \Data\Base::IS_YES : \Data\Base::IS_NO;
				$certificateGroup['Status'] = $status;
			}
		}
		return $certificateGroup;
	}

	private function getCompanyAndFidByPage($page) {
		$html = $this->getListHtml($page);
		$result = array();
		if (preg_match_all('/<a\s+href="EntInfo\.aspx\?Fid=(.*?)&.*?>(.*?)<\/a>/is', $html, $matches)) {
			for ($i = 0; $i < count($matches[1]); $i++) {
				$name = strip_tags($matches[2][$i]);
				$name = trim($name);
				$result[$matches[1][$i]] = $name;
			}
		} else {
			$this->error('解析入川企业列表失败', $page, \Data\CrawlError::ERROR_OUT_SC_LIST);
		}
		return $result;
	}

	private function getListHtml($page, $timeout = 5) {
		$url = 'http://web.scjst.gov.cn/webSite/project_EntCredit/RCEntInfoMain.aspx?fkind=180&c=';
		$post = array(
			'__EVENTTARGET' => 'Pager1$NavPage',
			'__EVENTARGUMENT' => '',
			'__LASTF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AgIDxGZW50VHlwZT7lm63mnpfnu7/ljJY8L0ZlbnRUeXBlPg0KICAgIDwvVGFibGUxPg0KICA8L05ld0RhdGFTZXQ+DQo8L2RpZmZncjpkaWZmZ3JhbT4EAwAAAA5TeXN0ZW0uVmVyc2lvbgQAAAAGX01ham9yBl9NaW5vcgZfQnVpbGQJX1JldmlzaW9uAAAAAAgICAgCAAAAAAAAAP//////////Cx4GaXNiaW5kZ2QWAgIBD2QWAmYPZBYEZg9kFggCAQ8PFgIfBQUBMWRkAgMPDxYCHwUFAzM2M2RkAgUPDxYCHwUFAjExZGQCBw8PFgIfBQUEMzk4NWRkAgEPZBYEZg8PFgIeB0VuYWJsZWRoZGQCAg8PFgIfFWhkZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUNUGFnZXIxOmJ0bl9Hb5N/LpgiVqa4Vpr6JKAbiSl+G9GTEizZa5r/bVDi0sZU',
			'__EVENTVALIDATION' => '/wEdAAfhE0uDvnqMlF2AgDP85pM123Q+Af49hntnAMgtBQ+bA+gPUnnQ1NWw7q+TtnLeKzOs+WxjJ6qj4/WzROmRxzCj5VQrx/HJ9omFWXtdSKCXenl0BIxXlkGGpC7zrIT3eArxTd6ixPy5SsVmFT15in5t5GAt8uLEF1+xr00+i2NGGvEw6mRkSG6QfZ5zUaecSds=',
			'txtFEntName' => '',
			'Pager1:NavPage' => $page,
 		);
		$header = array(
			'Referer:http://web.scjst.gov.cn/webSite/main/EntDetail.aspx?fkind=101',
			'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
		);
		$html = \Lib\Util\Comm::request($url, $post, $timeout, $header);
		if (!$html) {
			$this->log('抓取列表页超时');
			return $this->getListHtml($page, $timeout);
		}
		$html = \Lib\Util\Comm::unescape($html);
		return $html;
	}

	private function log($msg) {
		\Lib\Core\Log::instance()->write('OutSc', $msg, true);
	}

}